<!--
 * @Author: lilin_:）
 * @version: 1.0
 * @Descripttion: 
 * @Date: 2021-08-28 17:09:34
 * @LastEditors: sueRimn
 * @LastEditTime: 2021-08-28 17:53:42
-->
<template>
	<div>
		<vxe-modal v-model="addressBookFrom.addressBookFromIsshow" title="新建单位名" width="600" height="400" show-zoom resize remember>
			<template #default>
				<vxe-form :data="basicsVarSer" title-align="right" title-width="100">
					<vxe-form-item
						title="单位名称"
						field="unitName"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入城建税' } }"
					></vxe-form-item>
					<vxe-form-item
						title="纳税人识别号"
						field="taxpayerNum"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入教育税' } }"
					></vxe-form-item>

					<vxe-form-item
						title="地址电话"
						field="addressPhone"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入地方税' } }"
					></vxe-form-item>

					<vxe-form-item
						title="开户行"
						field="accountBank"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入个人税' } }"
					></vxe-form-item>

					<vxe-form-item
						title="开户行账号"
						field="bankAccount"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入企业税' } }"
					></vxe-form-item>

					<vxe-form-item
						title="联系人"
						field="contactPerson"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入企业税' } }"
					></vxe-form-item>
					<vxe-form-item
						title="联系电话1"
						field="phone1"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入企业税' } }"
					></vxe-form-item>
					<vxe-form-item
						title="联系电话2"
						field="phone2"
						span="12"
						:item-render="{ name: 'input', attrs: { placeholder: '请输入企业税' } }"
					></vxe-form-item>
					<vxe-form-item title="联系地址" field="addr" span="12" :item-render="{ name: 'input', attrs: { placeholder: '请输入企业税' } }">
					</vxe-form-item>

					<vxe-form-item title="单位类型" field="type" span="12" :item-render="{ name: 'input', attrs: { placeholder: '请输入企业税' } }">
					</vxe-form-item>
					<vxe-form-item align="center" span="24">
						<template #default>
							<vxe-button type="submit" status="primary" @click="showSubmit">保 存</vxe-button>
							<vxe-button @click="basicsVarSer.drawer = false">取消</vxe-button>
						</template>
					</vxe-form-item>
				</vxe-form>
			</template>
		</vxe-modal>
	</div>
</template>

<script lang="ts">
import { reactive, toRefs, toRaw } from 'vue';

export default {
	props: {
		addressBookFromIsshow: Boolean,
	},

	setup(props, ctx) {
		// console.log(toRaw(props), '子组件props');
		const isOKShow = () => {
			// 通过ctx调用emit事件 需要注意的是Vue2.x中使用 $emit切勿混淆
			ctx.emit('isOKShow', 2);
		};

		const state = reactive({
			addressBookFrom: {
				addressBookFromIsshow: props.addressBookFromIsshow,
				unitName: '', //单位名称s
				taxpayerNum: '', //纳税人识别号
				addressPhone: '',
				accountBank: '',
				bankAccount: '',
				bankName: '',
				contactPerson: '',
				phone1: '',
				phone2: '',
				qq: '',
				addr: '',
				type: '',
			},
		});

		return {
			...toRefs(state),
			isOKShow,
		};
	},
};
</script>

<style scoped lang="scss"></style>
